package com.copa.l1672;

/**
 * @author copa
 * @createDate 2022-08-30 15:59
 * @function 遍历法
 */
public class Test1 {

    public int maximumWealth(int[][] accounts) {
        int max = Integer.MIN_VALUE;
        int temp;
        for (int i = 0; i < accounts.length; i++) {
            temp = 0;
            for (int j = 0; j < accounts[i].length; j++) {
                temp += accounts[i][j];
            }
            max = Math.max(temp, max);
        }
        return max;
    }

    public static void main(String[] args) {
        int[][] accounts = {{2,8,7},{7,1,3},{1,9,5}};
        System.out.println(new Test1().maximumWealth(accounts));
    }
}
